/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gmovil_jpa.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author castlerock
 */
@Entity
@Table(name = "tipo_medio_pago")
@NamedQueries({
    @NamedQuery(name = "TipoMedioPago.findAll", query = "SELECT t FROM TipoMedioPago t"),
    @NamedQuery(name = "TipoMedioPago.findByIdTipoMedioPago", query = "SELECT t FROM TipoMedioPago t WHERE t.idTipoMedioPago = :idTipoMedioPago"),
    @NamedQuery(name = "TipoMedioPago.findByTipoMedioPago", query = "SELECT t FROM TipoMedioPago t WHERE t.tipoMedioPago = :tipoMedioPago"),
    @NamedQuery(name = "TipoMedioPago.findByObservacion", query = "SELECT t FROM TipoMedioPago t WHERE t.observacion = :observacion")})
public class TipoMedioPago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_tipo_medio_pago")
    private Integer idTipoMedioPago;
    @Basic(optional = false)
    @Column(name = "tipo_medio_pago")
    private String tipoMedioPago;
    @Column(name = "observacion")
    private String observacion;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoMedioPago")
    private List<OrdenCompra> ordenCompraList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "tipoMedioPago")
    private List<DetalleReciboMedioPago> detalleReciboMedioPagoList;

    public TipoMedioPago() {
    }

    public TipoMedioPago(Integer idTipoMedioPago) {
        this.idTipoMedioPago = idTipoMedioPago;
    }

    public TipoMedioPago(Integer idTipoMedioPago, String tipoMedioPago) {
        this.idTipoMedioPago = idTipoMedioPago;
        this.tipoMedioPago = tipoMedioPago;
    }

    public Integer getIdTipoMedioPago() {
        return idTipoMedioPago;
    }

    public void setIdTipoMedioPago(Integer idTipoMedioPago) {
        this.idTipoMedioPago = idTipoMedioPago;
    }

    public String getTipoMedioPago() {
        return tipoMedioPago;
    }

    public void setTipoMedioPago(String tipoMedioPago) {
        this.tipoMedioPago = tipoMedioPago;
    }

    public String getObservacion() {
        return observacion;
    }

    public void setObservacion(String observacion) {
        this.observacion = observacion;
    }

    public List<OrdenCompra> getOrdenCompraList() {
        return ordenCompraList;
    }

    public void setOrdenCompraList(List<OrdenCompra> ordenCompraList) {
        this.ordenCompraList = ordenCompraList;
    }

    public List<DetalleReciboMedioPago> getDetalleReciboMedioPagoList() {
        return detalleReciboMedioPagoList;
    }

    public void setDetalleReciboMedioPagoList(List<DetalleReciboMedioPago> detalleReciboMedioPagoList) {
        this.detalleReciboMedioPagoList = detalleReciboMedioPagoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idTipoMedioPago != null ? idTipoMedioPago.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoMedioPago)) {
            return false;
        }
        TipoMedioPago other = (TipoMedioPago) object;
        if ((this.idTipoMedioPago == null && other.idTipoMedioPago != null) || (this.idTipoMedioPago != null && !this.idTipoMedioPago.equals(other.idTipoMedioPago))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gmovil_jpa.entidades.TipoMedioPago[idTipoMedioPago=" + idTipoMedioPago + "]";
    }

}
